#!/bin/bash
#  This script is called by lsyncd to perform 'pre' and 'post' rsync tasks.
#
CMD=$1
case $CMD in
pre-www)
  rm /etc/nginx/sites-enabled/openstack-slushee.vhost
  systemctl reload nginx
  ;;
post-www)
  ln -s /etc/nginx/sites-available/openstack-slushee.vhost /etc/nginx/sites-enabled/openstack-slushee.vhost
  systemctl reload nginx
  ;;
pre-git)
  systemctl stop git.socket
  ;;
post-git)
  systemctl start git.socket
  ;;
*)
  echo "Unknown command."
esac
